<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="/xlive/script/xlv.js"></script>
</head>
<body>
	<div id="setProduct_main" xlvobject="xlv.obj.pane" xlvprop="{glow:{enable:true},border:{enable:true}}"
		xlvmethod="{
			styleFor:function(root){
				root.style.background='white';
			}
		}"
	>
	  					<div xlvobject="xlv.obj.dmTrigger"
							 xlvprop="{dmName:'menu',listener:{when:'afterModelChanged',notify:'setChanged',memoType:'create',memoMethods:'set-product'}}"
							 xlvmethod="{
							 		process:function(options){
							 			var dm=this.getDataModel();
							 			if('true'!=dm.getValue('set-product.return.valid')){
							 				return alert('set Product error :'+dm.getValue('set-product.return.why'));
							 			}
							 			this.getPaneById('setProduct_main').dispose();
									}
							 }"
						>
						</div>
	  
	  <div id="pxml" xlvobject="xlv.obj.pxml"  style="width:320px"
	    xlvprop="{
	    	completeString:'完成'
	    }"
	  	xlvmethod="{
	  		initial:function(){
	  			this.$self('initial');
	  			var addons =this.getDataModel('addons').getAddons();
	  			var options =this.getDataModel('options').getOptions();
	  			var dm = this.getDataModel('menu');
	  			var node=dm.getNode('set-product');
	  			xlv.util.selectXmlSingleNode('options',node).setAttribute('options',options);
	  			xlv.util.selectXmlSingleNode('addons',node).setAttribute('options',addons);
	  			this.build(node);
	  		},
	  		complete:function(){
	  			//alert(xlv.imp.xml.method.xml_nodeToString(this.$P.pNode));
	  			this.getDataModel('menu').webMethod('set-product');
	  		},
	  		cancel:function(){
	  			this.getPaneById('setProduct_main').dispose();
	  		},
	  		nodeForBox:function(node,box){
	  			this.$self('nodeForBox',node,box);
	  			var ul=xlv.util.findChild(box,{tag:'ul',id:'pxml_extended'});
	  			if(ul)return;
	  			var pxml=node.getAttribute('pxml');
	  			if(pxml=='select') {
	  				box.addExtend=true;
	  				var ul=document.createElement('ul');
	  				ul.setAttribute('id', 'pxml_extended');
	  				ul.pNode=node;
	  				var li=document.createElement('li');
	  				li.pNode=node;
	  				ul.appendChild(li);
	  				ul.style.marginTop='40px';
	  				li.style.width='100%';
	  				li.style.height='32px';
	  				li.style.textAlign='center';
	  				li.style.background='url(/xlive/images/pxml/btnb_bg.gif) left bottom';
	  				box.appendChild(ul);
	  				if('options'==node.tagName){
	  					xlv.util.setElementValue(li, 'options management');
	  					li.onclick=function(){
	  						this.getPaneById('setProduct_main').dispose();
	  						var prop={callback:'setProduct'};
	  						return this.getDesktop().showPane('/xlive/rst/setOptions.html',prop,null,{paneIn:'center',opacity:0.2,color:'gray'});
	  					}.bind(this);
	  					return;
	  				}
	  				if('addons'==node.tagName){
	  					xlv.util.setElementValue(li, 'addons management');
	  					li.onclick=function(){
	  						this.getPaneById('setProduct_main').dispose();
	  						var prop={callback:'setProduct'};
	  						return this.getDesktop().showPane('/xlive/rst/setAddons.html',prop,null,{paneIn:'center',opacity:0.2,color:'gray'});
	  					}.bind(this);
	  					return;
	  				}
	  			}
	  		}
	  	}"
	  >
	  </div>
	  
	  
	</div>
</body>
</html>
